home *** CD-ROM | disk | FTP | other *** search
File List | 1990-11-14 | 1.1 KB | 41 lines |
- ' Please don't mess up the user's colors!
- '
- ' ------------- SAVE ORIGINAL COLOR PALETTE -----------------------
- ' Run this first
- '
- PROCEDURE save_pal
- '
- DIM spalette%(16,3) ! This will hold the user's colors
- '
- FOR z%=0 TO 15
- DPOKE CONTRL,26 ! VDI inquire color function
- DPOKE CONTRL+2,0 ! No PTSIN
- DPOKE CONTRL+6,2 ! Two INTIN's
- DPOKE INTIN,z% ! Color index
- DPOKE INTIN+2,0 ! We want the color stored here
- VDISYS
- spalette%(z%,0)=DPEEK(INTOUT+2) ! Red value
- spalette%(z%,1)=DPEEK(INTOUT+4) ! Green value
- spalette%(z%,2)=DPEEK(INTOUT+6) ! Blue value
- NEXT z%
- RETURN
- '
- ' --------------------- RESTORES PALETTE -------------------
- ' Run this at end of program
- '
- PROCEDURE restore_pal
- ' Dimensions: Spalette%(16,3)
- '
- FOR z%=0 TO 15
- DPOKE CONTRL,14 ! VDI set color function
- DPOKE CONTRL+2,0 ! No PTSIN
- DPOKE CONTRL+6,4 ! Four INTIN's
- DPOKE INTIN,z% ! Color index
- DPOKE INTIN+2,spalette%(z%,0) ! Red value
- DPOKE INTIN+4,spalette%(z%,1) ! Green value
- DPOKE INTIN+6,spalette%(z%,2) ! Blue value
- VDISYS
- NEXT z%
- RETURN
- '
-